<div class="userinfo_bar">
	<b class="f14">您好，<span id="account"></span>！欢迎回来!
	</b>
</div>
<div class="box clearfix" id="app">
	<h3>用户信息</h3>
	<dl class="userinfo_box">
		<dt>
			<a class="ico"><img v-bind:src="users.avatar" id="user_ico_img"  width="100"
				height="100" alt="" /></a>
		</dt>
		<dd>
			<table width="100%" cellpadding="0" cellspacing="0">
				<col width="350px" />
				<tr>
				</tr>
				<tr>
					<td>昵称：<b style="color: darkgreen">{{users.nickname}}</b></td>
					<td v-if="status==2">当前信息状态为:<label >公开</label><button @click="closeUser(users.uid)" class="btn-success">锁定信息</button></td>
					<td v-if="status==1">当前信息状态为:<label >不公开</label><button @click="openUser(users.uid)" class="btn-success">公开信息</button></td>
				</tr>
				<tr>
					<td>余额：<b class="red2">￥{{users.money}}</b></td>
				</tr>
				<tr>
					<td>手机号：<b style="color: darkgreen">{{users.phoneNumber}}</b></td>
				</tr>
				<tr>
					<td>QQ：<b style="color: darkgreen">{{users.qq}}</b></td>
				</tr>
				<tr>
					<td>地址信息：<b style="color: darkgreen">{{users.address}}</b></td>
				</tr>
			</table>
		</dd>
	</dl>
</div>
<h3 class="bg">我的订单</h3>
<div class="box m_10">
	<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
		<col width="140px" />
		<thead>
			<tr>
				<th>订单编号</th>
				<th>下单日期</th>
				<th>收货人</th>
				<th>支付方式</th>
				<th>总金额</th>
				<th>订单状态</th>
			</tr>
		</thead>
		<tbody id="orderData"> </tbody>
		<tfoot>
			<tr>
				<td colspan="6" class="t_r"><a class="blue orderlist" href="javascript:void(0)">更多订单&gt;&gt;</a></td>
			</tr>
		</tfoot>
	</table>
</div>
<script type="text/javascript">
	new Vue({
		el:"#app",
		data:{
			users:[],
			status:"",
			close:1,
			open:2
		},
		mounted(){	//当页面元素加载完毕时执行
			axios.get("/user/selectMyByUid")
					.then(res => {
						console.info(res);
						this.users=res.data.data;
						this.status=res.data.data.isOpen;
					});
		},
		methods:{
			closeUser:function () {
				console.log(this.close);
				axios.post("/user/updateisOpenByUid?isOpen="+this.close)
						.then(res => {
							console.info(res);
							if (res.data.code ==200 ){
								this.status=this.close;
							}
						});
			},
			openUser:function () {
				console.log(this.open);
				axios.post("/user/updateisOpenByUid?isOpen="+this.open)
						.then(res => {
							console.info(res);
							if (res.data.code ==200 ){
								this.status=this.open;
							}
						});
			}
		},
	});
</script>